package com.job.common.resultInfo;

import com.fasterxml.jackson.annotation.JsonView;
import lombok.Data;

import java.io.Serializable;
import java.util.List;

/**
 * @author LiuDongBo
 */
@Data
public class BaseResult<T> implements Serializable {

    private Integer resultCode;

    private String errorMsg;

    private Long total;

    private String jwtToken;

    /**
     * 是否有更多数据,小程序使用
     */
    private Boolean hasMore;

    private T resultData;

    private Object expandData;

    private List<T> treeData;

    public BaseResult() {
    }

    public BaseResult(Integer resultCode, String errorMsg, Boolean hasMore) {
        this.resultCode = resultCode;
        this.errorMsg = errorMsg;
        this.hasMore = hasMore;
    }

    public BaseResult(Integer resultCode, String errorMsg) {
        this.errorMsg = errorMsg;
        this.resultCode = resultCode;
    }

    public BaseResult(Integer resultCode, List<T> treeData) {
        this.resultCode = resultCode;
        this.treeData = treeData;
    }

    public BaseResult(Integer resultCode, T resultData) {
        this.resultCode = resultCode;
        this.resultData = resultData;
    }
    public BaseResult(Integer resultCode, T resultData, Object expandData) {
        this.resultCode = resultCode;
        this.resultData = resultData;
        this.expandData=expandData;
    }

    public BaseResult(Integer resultCode, Long total, T resultData) {
        this.resultCode = resultCode;
        this.total = total;
        this.resultData = resultData;
    }

    public BaseResult(Integer resultCode, T resultData, Object expandData, Boolean hasMore) {
        this.resultCode = resultCode;
        this.resultData = resultData;
        this.expandData = expandData;
        this.hasMore = hasMore;
    }

    public BaseResult(Integer resultCode, T resultData, Boolean hasMore) {
        this.resultCode = resultCode;
        this.resultData = resultData;
        this.hasMore = hasMore;
    }

    public BaseResult(Integer resultCode, Long total, T resultData, Object expandData) {
        this.resultCode = resultCode;
        this.total = total;
        this.resultData = resultData;
        this.expandData = expandData;
    }

}
